<extend name="./Application/Admin/View/common/base.html" />
<block name="crumb">
    <span class="c-gray en">&gt;</span> 商品管理
    <span class="c-gray en">&gt;</span> 商品模型
</block>
<block name="content">
    <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="{:U('Model/addModel')}" class="btn btn-primary radius"><i class="Hui-iconfont"></i> 添加商品模型</a></span>  </div>
    <div class="mt-10">
        <table class="table table-border table-bordered table-bg table-sort">
            <thead>
            <tr class="text-c">
                <th width="30">ID</th>
                <th width="350">商品模型名称</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
                <volist name="models" id="model" key="k" >
                    <tr class="text-c">
                        <td>{$k}</td>
                        <td>{$model['m_name']}</td>
                        <td class="f-14 product-Model-manage">
                            <a href="{:U('Model/attr', array('id'=>$model['id']))}"  class="btn btn-success radius size-MINI"><i class="Hui-iconfont Hui-iconfont-search2"></i>属性列表</a>
                            <a href="{:U('Model/param', array('id'=>$model['id']))}"  class="btn btn-warning radius size-MINI"><i class="Hui-iconfont Hui-iconfont-search2"></i>规格列表</a>
                            <a href="{:U('Model/edit', array('id'=>$model['id']))}"  class="btn btn-secondary radius size-MINI"><i class="Hui-iconfont Hui-iconfont-edit"></i>编辑</a>
                            <a href="javascript:;"  class="btn btn-danger radius size-MINI del_Model" iid="{$model['id']}"><i class="Hui-iconfont Hui-iconfont-del2"></i>删除</a>
                        </td>
                    </tr>
                </volist>
            </tbody>
        </table>
    </div>
    <div class="page" style="margin-top: 10px;">{$page}</div>
</block>

<!--自己的css和js-->
<block name="css">
    <link href="__PUBLIC__/Admin/static/ext/css/zoomify.css" rel="stylesheet" type="text/css" />
</block>
<block name="js">
    <script type="text/javascript" src="__PUBLIC__/Admin/static/ext/js/zoomify.js"></script>
    <script type="text/javascript">
        $('.large_img').zoomify();
        $(function () {
            $('.del_Model').click(function () {
                var _this = $(this);
                layer.confirm('您确认删除此商品模型吗？', {
                    btn: ['确认','取消']
                }, function(){
                    $.ajax({
                        url: "{:U('Model/del')}",
                        type: "post",
                        data: {
                          id: _this.attr('iid')
                        },
                        beforeSend: function () {
                            layer.msg('删除商品模型中..', {icon: 16,time:500});
                        },
                        success: function (msg) {
                            msg==1 ? window.location.href = "{:U('Model/index')}" : layer.msg('修改失败!', {icon: 2,time:1000});
                        }
                    });
                });
            });
        });


    </script>
</block>



